import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import '@/styles/index.scss'
import '@/icons'
import axios from 'axios'
import Tinymce from '@/components/tinymce/index.vue'
// import Csmlabel from '@/control/leftpanel/csmlabel/index.vue'
// import CsmwjHeader from '@/control/leftpanel/csmwj-header/index.vue'
// import CsmwjFooter from '@/control/leftpanel/csmwj-footer/index.vue'
// import CsmwjRadioGroup from '@/control/leftpanel/csmwj-radio-group/index.vue'
// import CsmwjCheckboxGroup from '@/control/leftpanel/csmwj-checkbox-group/index.vue'
// import Csmwjscore from '@/control/leftpanel/csmwj-score/index.vue'
// import Csmwjinput from '@/control/leftpanel/csmwj-input/index.vue'

Vue.component('tinymce', Tinymce)
// Vue.component('csmlabel', Csmlabel)
// Vue.component('csmwj-header', CsmwjHeader)
// Vue.component('csmwj-footer', CsmwjFooter)
// Vue.component('csmwj-radio-group', CsmwjRadioGroup)
// Vue.component('csmwj-checkbox-group', CsmwjCheckboxGroup)
// Vue.component('csmwj-score', Csmwjscore)
// Vue.component('csmwj-input', Csmwjinput)

// csm:自动加载@/control/rightpanel目录下所有的vue为components
const requireComponent = require.context('@/control/previewpanel/', true, /\.vue$/);
requireComponent.keys().forEach(fileName => {
  const componentConfig = requireComponent(fileName);
  const componentName = fileName
    .split('/').pop()
    .replace(/\.\w+$/, '');
  Vue.component(componentName, componentConfig.default || componentConfig);
});


Vue.config.productionTip = false
Vue.prototype.$axios = axios

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
